import {request} from '@umijs/max';
import * as API from "@/services";


/** 退款记录 分页检索请求 */
export async function queryRefundRecords(params: API.RefundRecordPageQueryParams): Promise<API.RespPageResult<API.RefundRecord>> {
  return request('/api/v1/refund-record', {
    params,
  });
}

/** 退款记录 详情请求 */
export async function queryRefundRecord(bizId: API.EntityId): Promise<API.RespResult<API.RefundRecord>> {
  return request(`/api/v1/refund-record/${bizId}`);
}

/** 退款记录 创建请求 */
export async function createRefundRecord(entity: API.RefundRecord_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/refund-record`, {
    method: 'POST',
    data: entity,
  });
}

/** 退款记录 修改请求 */
export async function modifyRefundRecord(entity: API.RefundRecord_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/refund-record/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 退款记录 修改(部分)请求 */
export async function patchRefundRecord(entity: API.RefundRecord_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/refund-record/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 退款记录 删除请求 */
export async function deleteRefundRecord(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/refund-record/${bizId}`, {
    method: 'DELETE',
  });
}

/** 退款记录 批量删除请求 */
export async function deleteRefundRecords(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/refund-record`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
